//模块
import Vue from "vue";
//插件
import VueRouter from "vue-router";

//路由组件
// import ShouYe from "../views/ShouYe.vue";
// import FenLei from "../views/FenLei.vue";
//路由组件  懒加载
// const ShouYe = () => import("../views/ShouYe.vue");
// const FenLei = () => import("../views/FenLei.vue");

//使用插件
Vue.use(VueRouter);

export default new VueRouter({
    mode:"hash",
    routes:[
        {
            path:'/shouye',
            name:"shouye",
            component:() => import("../views/ShouYe.vue"),
            children:[
                {
                    // path:"/shouye/itemdetail",
                    path:"itemdetail",
                    name:"itemdetail",
                    component:()=>import("../views/shouYe/ItemDetail.vue")
                }
            ],
            meta:{
                show:true
            }
        },
        {
            path:"/fenlei",
            name:"fenlei",
            component:() => import("../views/FenLei.vue"),
            meta:{
                show:true
            }
        },
        {
            path:"/car",
            name:"car",
            component:() => import("../views/Car.vue"),
        },
        {
            path:"/",
            redirect:"/shouye"
        }
    ]
})